package br.edu.utfpr.servidor.rmi;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

import br.edu.utfpr.comum.RmiProvider;
import br.edu.utfpr.servidor.view.ServidorView;


public class Servidor {

    private Registry registry;
    private static final int PORTA = 1099;

    public void inicia() {
        try {
            RmiProvider provider = new RmiProviderImpl();
            registry = LocateRegistry.createRegistry(PORTA);
            registry.rebind("BackupToolsService", provider);
            ServidorView.addLog("Servidor executando servico BackupToolsService na porta "+PORTA);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
